package com.test.ayi.controller;

import com.test.ayi.util.RedisUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * SpEL表达式示例控制器
 * 展示如何使用SpEL访问环境变量和配置属性
 */
@RestController
@RequestMapping("/redis")
public class RedisController {
    @Resource
    private RedisUtil redisUtil;

    @GetMapping("/setString")
    public boolean existKey(String key, String value) {
        return redisUtil.set(key, value, 10);
    }

}
